package com.xkdx.guangguang.fragment.my.setup;

import java.util.HashMap;

import android.content.Context;

import com.xkdx.caipiao.HomePageActivity;
import com.xkdx.guangguang.fragment.BaseFragment;
import com.xkdx.guangguang.module.network.AbsModule;
import com.xkdx.guangguang.module.network.HttpTask;
import com.xkdx.guangguang.module.network.JsonHttpRequest;

public class UpdateVersionPresistener extends HttpTask {

	public UpdateVersionPresistener(BaseFragment baseFragment) {
		this.baseFragment = baseFragment;

		requestInstent = new JsonHttpRequest();
	}
	
	public UpdateVersionPresistener(Context context) {
		this.context = context;

		requestInstent = new JsonHttpRequest();
	}

	@Override
	protected void onPostExecute(HashMap<String, AbsModule> result) {
		// TODO Auto-generated method stub
		super.onPostExecute(result);
		if (baseFragment != null) {
			baseFragment.showLoaded(result);
		}else if(context != null && context instanceof HomePageActivity){
			((HomePageActivity)context).versionCheckedOver(result);
		}

	}

}
